// pages/choujiang1/choujiang1.js
const app = getApp()
const INTERVAL = 10000;
import {timestampToTime} from "../../utils/util.js";
Page({

  /**
   * 页面的初始数据
   */
  data: {
    appurl: app.apiurl,
    apiimg: app.apiimg,
    time2:'',
    chou: true,
    autoplay: true,
    interval: 2000,
    duration: 500,
    duobao_id:0,
    list2: [],
    list3: [],
    list4: [],
    xyjl_list:[],
    list: [
      '1', '2', '3', '4', '5'
    ],
    ggid: '',
    gglist: '',
    gglist1: '',
    tanchu13: false,
    tanchu23: false,
    tanchuang66: false,
    tanchuang15: false,
    tanchuang25: false,
    tanchuang35: false,
    tanchuang45: false,
    tanchuang55: false,
    tanchuang65: false,
    cur_max_num:'',
    idx: 1,
    array1: ['不限', '男性', '女性'],
    idx1: 0,
    array2: ['不限', '胜率高', ],
    idx2: 0,
    idx3: 0,
    pipei_kaihei: false,
    pipei_kaihei1: '',
    num1:"?",
    num2:'?',
    num3:'?',
    num4:'?',
    duobao1:[],
    duobao2:[],
    duobao3:[],
    page_no: 1,
    max_num:'0',
    tanchuang12: false,
    tanchuang12_flag: false,
    tanchuang13: false,
    tanchuang13_flag: false,
    list5:[],
    list6:[],
    jifen:'',
    jifen1:'',
    cur_paiming:'',
    user_total_integral:''
  },
  bindPickerChange1: function (e) {
    console.log('picker发送选择改变，携带值为', e.currentTarget.dataset.index)
    this.setData({
      idx1: e.currentTarget.dataset.index
    })
  },
  bindPickerChange2: function (e) {
    console.log('picker发送选择改变，携带值为', e.currentTarget.dataset.index)
    this.setData({
      idx2: e.currentTarget.dataset.index
    })
  },
  bindPickerChange3: function (e) {
    console.log('picker发送选择改变，携带值为', e.currentTarget.dataset.index)
    this.setData({
      idx3: e.currentTarget.dataset.index
    })
  },
  z_tapbar(e) {
    let index = e.currentTarget.dataset.id
    this.setData({
      idx: index,
      page_no:1
    })
    this.z_jilu()
    this.z_jilu2()
  },
  z_open() {
    this.setData({
      tanchu13: true
    })
  },
  z_open1() {
    this.setData({
      tanchuang15: true
    })
    this.z_jilu6()
  },
  z_open2() {
    this.setData({
      tanchuang25: true
    })
  },
  z_close() {
    this.setData({
      tanchu13: false,
      tanchuang66: false,
      tanchuang15: false,
      tanchuang25: false,
      tanchuang35: false,
      tanchuang45: false,
      tanchuang55: false,
      tanchuang65: false
    })
    this.z_jilu3()
    this.z_jilu5()
  },
  z_close1() {
    this.setData({
      pipei_kaihei: false
    })
    this.z_jilu3()
    this.z_jilu5()
    wx.setStorageSync("pipei_kaihei", _this.pipei_kaihei1.member_id)
  },
  z_close2() {
    this.setData({
      tanchuang55: false,
      tanchuang65: false,
      list6:[]
    })
    this.z_jilu()
    this.z_jilu2()
    this.z_jilu3()
    this.z_jilu7()
    this.luckCb1()
  },
  luckCb(e) {
    console.log(e);
    // if(e.detail){
    // 	this.setData({
    // 		luck_num:e.detail
    // 	})
    // }
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
      "luck_id": e.detail
    }
    wx.request({
      url: app.apiurl + 'api/member/extractLuckBagBs',
      method: 'POST',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {}
    })
  },
  luckCb1() {
    // console.log('sdfsdfsdf', e)
    let _this = this
    _this.z_yonghu()
    _this.z_shaiji()
    _this.setData({
      // luckCjNum: e.detail,
      // tanchuang66: true
    })
    _this.z_wancheng2()
  },
  z_wancheng2() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
      "up_field": 'zsdb_status'
    }
    wx.request({
      url: app.apiurl + 'api/member/upNewUserGuide',
      method: 'POST',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {

      }
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let that = this
    that.z_shaiji()
    // that.setData({
    //   duobao_id:options.id
    // })  
    this.timer = setInterval(function () {
      that.z_kaihei3()
      that.z_kaihei31()
      // 这里可以执行定时器需要执行的任务
    }, INTERVAL);
  },
  z_dengluyanzeng(){
    wx.request({
      url: app.apiurl + 'api/home/xcxLoginStatus',
      method: 'GET',
      data: {},
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        if (res.data.code == '1001') {
          if (res.data.data.is_force_login == '1') {
            // wx.reLaunch({
            //   url: '/pages/login/login'
            // });
            wx.showToast({
              title: '请注册/登录会员账号',
              icon: 'none',
              duration: 2000
            })
            setTimeout(function(){
              wx.reLaunch({
                url: '/pages/member/member',
              })
            },2500)
          }
        }
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.guanggao1()
    this.z_idxgg()
    this.z_yonghu()
    this.z_baoxiang2()
    this.z_jilu()
    this.z_peizhi()
    this.z_jilu1()
    this.z_jilu2()
    this.z_jilu3()
    this.z_jilu4()
    this.z_jilu5()
    this.z_kaihei3()
    this.z_kaihei31()
    this.z_jilu7()
  },
  z_wancheng3() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
      "up_field": 'duobao_status'
    }
    wx.request({
      url: app.apiurl + 'api/member/upNewUserGuide',
      method: 'POST',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {

      }
    })
  },
  guanggao1() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
    }
    wx.request({
      url: app.apiurl + 'api/config/advertPage',
      method: 'POST',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        console.log(res.data.data)
        _this.guanggao2()
        _this.guanggao3()
      }
    })
  },
  guanggao2() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
    }
    wx.request({
      url: app.apiurl + 'api/config/advert?page_id=4',
      method: 'GET',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        _this.setData({
          gglist: res.data.data[0]
        })
      }
    })
  },
  z_kvlianjia(e){
    let _this = this
    let link_url = e.currentTarget.dataset.url
    let id = e.currentTarget.dataset.url
    if(link_url != undefined){
      wx.navigateTo({
        url: link_url,
      })
    }
  },
  guanggao3() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
    }
    wx.request({
      url: app.apiurl + 'api/config/advert?page_id=3',
      method: 'GET',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        _this.setData({
          gglist1: res.data.data[0]
        })
      }
    })
  },
  z_idxgg() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
    }
    wx.request({
      url: app.apiurl + 'api/home/index',
      method: 'POST',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        _this.setData({
          login: true,
          idx_gg: res.data.data,
          // time1:res.data.data.activity_info.diff_time
        })
      }
    })
  },
  z_yonghu() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
    }
    wx.request({
      url: app.apiurl + 'api/member/myInfo',
      method: 'POST',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        if (res.data.code == '1001') {
          _this.setData({
            login: true,
            yonghu: res.data.data
          })
        }
      }
    })
  },
  z_baoxiang2() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
    }
    wx.request({
      url: app.apiurl + 'api/luck_bag/luckBagList',
      method: 'POST',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        _this.setData({
          lucksData2: res.data.data
        })
      }
    })
  },
  z_shaiji() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token")
    }
    wx.request({
      url: app.apiurl + 'api/duobao/duobaoDetail',
      method: 'GET',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        let max_num1 = String(res.data.data.max_num)
        let max_num2 = String(res.data.data.max_num)[0]
        let max_num3 = max_num2
        for(let i = 1;i<max_num1.length;i++){
          max_num3 = max_num3 + '?'
        }
        _this.countdown2(res.data.data.diff_time)
        setTimeout(function(){
          _this.setData({
            saiji: res.data.data,
            duobao_id:res.data.data.id,
          })
          _this.z_bsInfoData()
        },500)
      }
    })
  },
  z_bsInfoData() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
    }
    wx.request({
      url: app.apiurl + 'api/home/bsInfoData',
      method: 'POST',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        let max_num1 = String(res.data.data.max_num)
        let max_num2 = String(res.data.data.max_num)[0]
        let max_num3 = max_num2
        for(let i = 1;i<max_num1.length;i++){
          max_num3 = max_num3 + '?'
        }
        _this.setData({
          cur_paiming:res.data.data.xydb_pm,
          cur_max_num:res.data.data.cur_max_num,
          user_total_integral:res.data.data.user_total_integral,
          max_num:res.data.data.max_num,
        })
      }
    })
  },
  countdown2: function (difftime1) {
    const that = this;
    let difftime = Number(difftime1);
    const interval = setInterval(function () {
      if (difftime > 0) {
        difftime--;
        var seconds = difftime;
        var days = Math.floor(seconds / (3600*24));
        seconds %= 3600*24;
     
        var hours = Math.floor(seconds / 3600);
        seconds %= 3600;
     
        var minutes = Math.floor(seconds / 60);
        seconds %= 60;
        
        that.setData({
          time2: days + '天' + hours + '时' + hours + '分',
        })
      } else {
        clearInterval(interval);
        that.z_shaiji();
        // 倒计时结束的操作
      }
    }, 1000);
  },
  z_shuaxin(){
    let _this = this
    _this.setData({
      saiji:''
    })
    _this.z_shaiji()
    _this.z_jilu()
    _this.z_jilu2()
  },
  z_jilu() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token")
    }
    wx.request({
      url: app.apiurl + 'api/duobao/wqRecordList?page_no=' + _this.data.page_no + '&page_num=10',
      method: 'GET',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        if(_this.data.page_no == 1){
          _this.setData({
            list3: res.data.data.list
          })
        } else {
        let list3 = _this.data.list3
        for(let i=0;i< res.data.data.list.length;i++){
          list3.push(res.data.data.list[i])
        }
        _this.setData({
          list3: list3
        })
      }
      }
    })
  },
  z_jilu1() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
      "is_limit":'1',
      "page_no": "1", //第几页
      "page_num": "10", //每页显示数量
      "type": "1", //奖品类型 0-不限 1-兑换奖品  2-推荐活动奖品
      "con_type": "0", //奖品内容  0-不限  1-实物 2-虚拟 3-金币 4-钻石 5-夺宝券
      "jpdl": "", //奖品大类id
      "name": "", //奖品名称
      "order_type": "0", //排序  0 不限制   1-兑换数量降序   2-兑换钻石升序
      "sx_wyf": "0", //筛选条件   1-无运费
      "sx_kdh": "0" //筛选条件   1-可兑换
    }
    wx.request({
      url: app.apiurl + 'api/prize/list',
      method: 'POST',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        _this.setData({
          list1: res.data.data.list
        })
      }
    })
  },
  z_jilu2() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token")
    }
    wx.request({
      url: app.apiurl + 'api/duobao/myRecordList?page_no=' + _this.data.page_no + '&page_num=10',
      method: 'GET',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        if(_this.data.page_no == 1){
          _this.setData({
            list2: res.data.data.list
          })
        } else {
          let list2 = _this.data.list2
          for(let i=0;i< res.data.data.list.length;i++){
            list2.push(res.data.data.list[i])
          }
          _this.setData({
            list2: list2
          })
        }
      }
    })
  },
  z_jilu3() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token")
    }
    wx.request({
      url: app.apiurl + 'api/config/unprizeList?fbwz_type=5',
      method: 'GET',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        _this.setData({
          mylist: res.data.data
        })
      }
    })
  },
  z_jilu4() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
      "page_no": "1",
      "page_num": "500", 
      "duobao_id": _this.data.duobao_id
    }
    wx.request({
      url: app.apiurl + 'api/duobao/myLuckSzList',
      method: 'POST',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        _this.setData({
          list4: res.data.data.list
        })
      }
    })
  },
  z_jilu5() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
      "page_no": "1",
      "page_num": "500", 
      "duobao_id": _this.data.duobao_id
    }
    wx.request({
      url: app.apiurl + 'api/duobao/myLuckSzList',
      method: 'POST',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        _this.setData({
          list4: res.data.data.list
        })
      }
    })
  },
  z_jilu6() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
    }
    wx.request({
      url: app.apiurl + 'api/duobao/duobaoIntegralDetail?duobao_id=' + _this.data.duobao_id,
      method: 'POST',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        let list5 = []
        let jifen = ''
        let jifen1 = ''
        for(let i = 0;i<res.data.data.list.length;i++){
          if(i < res.data.data.list.length-2){
            list5.push(res.data.data.list[i])
          } else if(i != res.data.data.list.length-1){
            jifen1 = res.data.data.list[i]
          } else {
            jifen = res.data.data.list[i].value
          }
        }
        console.log('sdfsdfsdfsdfsd',list5)
        _this.setData({
          list5: list5,
          jifen:jifen,
          jifen1:jifen1
        })
      }
    })
  },
  z_jilu7() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token")
    }
    wx.request({
      url: app.apiurl + 'api/duobao/myRecordList?page_no=1&page_num=500',
      method: 'GET',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        _this.setData({
          list6: res.data.data.list
        })
        // if(_this.data.page_no == 1){
        //   _this.setData({
        //     list6: res.data.data.list
        //   })
        // } else {
        //   let list6 = _this.data.list6
        //   for(let i=0;i< res.data.data.list.length;i++){
        //     list6.push(res.data.data.list[i])
        //   }
        //   _this.setData({
        //     list6: list6
        //   })
        // }
      }
    })
  },
  z_peizhi() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
    }
    wx.request({
      url: app.apiurl + 'api/config/configBase',
      method: 'GET',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        _this.setData({
          peizhi: res.data.data
        })
      }
    })
  },
  z_kaihei3() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token")
    }
    wx.request({
      url: app.apiurl + 'api/season/jcTanInfo',
      method: 'GET',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        if (res.data.data != '') {
          _this.setData({
            xinxi: res.data.data
          })
          // if (wx.getStorageSync("jiangpin") != res.data.data.duobao_id) {
            if(!_this.data.tanchuang12 && !_this.data.tanchuang12_flag){
              wx.setStorageSync("jiangpin", res.data.data.id)
              // wx.setStorageSync("jiangpin_prize_id", res.data.data.prize_id)
              _this.setData({
                tanchuang12: true,
              })
            }
          // }
        }
      }
    })
  },
  z_kaihei5() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
      "id": wx.getStorageSync("jiangpin")
    }
    wx.request({
      url: app.apiurl + 'api/season/upXyTan',
      method: 'POST',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        _this.setData({
          tanchuang12: false,
          tanchuang12_flag:false
        })
      }
    })
  },
  z_kaihei31() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token")
    }
    wx.request({
      url: app.apiurl + 'api/duobao/duobaoTanChuangInfo',
      method: 'GET',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        if (res.data.data != '') {
          _this.setData({
            xinxi1: res.data.data
          })
            if(!_this.data.tanchuang13 && !_this.data.tanchuang13_flag){
              wx.setStorageSync("jiangpin1", res.data.data.duobao_id)
              wx.setStorageSync("jiangpin_prize_id1", res.data.data.prize_id)
              _this.setData({
                tanchuang13: true,
              })
            }
        }
      }
    })
  },
  z_kaihei51() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
      "duobao_id": wx.getStorageSync("jiangpin1")
    }
    wx.request({
      url: app.apiurl + 'api/duobao/upDuobaoTan',
      method: 'POST',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        _this.setData({
          tanchuang13: false,
          tanchuang13_flag:false
        })
      }
    })
  },
  start() {
    let _this = this;
    if (wx.getStorageSync("user_token") == "") {
      _this.z_dengluyanzeng()
    } else {
      let num = 40;
      if(num > _this.data.saiji.csqye){
        num = _this.data.saiji.csqye;
      }
      _this.setData({
        chou: false,
        num1:"?",
        num2:"?",
        num3:"?",
        num4:"?"
      })
      let params = {
        "token": wx.getStorageSync("user_token"),
        "duobao_id": _this.data.duobao_id,
        "num": num
      }
      wx.request({
        url: app.apiurl + 'api/duobao/duobaoLottery',
        method: 'POST',
        data: params,
        header: {
          'content-type': 'application/x-www-form-urlencoded' // 修改请求
        },
        success(res) {
          if (res.data.code == '1002') {
            wx.showToast({
              title: res.data.msg,
              icon: 'none',
              duration: 2000
            })
          } 
          else {
            _this.z_choujiang(res.data.data)
          }
          _this.z_wancheng3()
        }
      })
    }
  },
  z_choujiang(e){
    let _this = this
    let list1 = [];
    let list2 = [];
    let list3 = []
    let num1 = Math.floor(Number(e.cj_num_list.length) / 2);
    for(let i=0;i<num1;i++){
      list1.push(e.cj_num_list[i])
    }
    for(let j=num1;j<e.cj_num_list.length;j++){
      list2.push(e.cj_num_list[j])
    }
    for(let k=0;k<e.cj_num_list.length;k++){
      if(e.cj_num_list[k].num_flag == '1'){
        list3.push(e.cj_num_list[k])
      }
    }
        _this.setData({
          num4: e.cj_num_info.cj_num_detail.num4,
          duobao1:list1,
          duobao2:list2,
          duobao3:list3,
          xyjl_list:e.xyjl_list
        })
        setTimeout(function () {
          _this.setData({
            num3: e.cj_num_info.cj_num_detail.num3
          })
          setTimeout(function () {
            _this.setData({
              num2: e.cj_num_info.cj_num_detail.num2
            })
            setTimeout(function(){
              _this.setData({
                num1: e.cj_num_info.cj_num_detail.num1
              })
              setTimeout(function () {
                _this.setData({
                  chou: true,
                  tanchuang65:true
                })
              }, 500)
            },200)
          }, 500)
        }, 500)
  },
  start1() {
    let _this = this
    _this.setData({
      chou: false,
      num1:"?",
      num2:"?",
      num3:"?",
      num4:"?"
    })
    let params = {
      "token": wx.getStorageSync("user_token"),
      "duobao_id": _this.data.duobao_id,
      "num": "10" 
    }
    wx.request({
      url: app.apiurl + 'api/duobao/duobaoLottery',
      method: 'POST',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        if (res.data.code == '1002') {
          wx.showToast({
            title: res.data.msg,
            icon: 'none',
            duration: 2000
          })
        } 
        else {
          _this.z_choujiang1(res.data.data)
        }
        _this.z_wancheng3()
      }
    })
  },
  z_choujiang1(e){
    let _this = this
        _this.setData({
          num4: e.cj_num_info.cj_num_detail.num4,
          duobao2: e
        })
        setTimeout(function () {
          _this.setData({
            num3: e.cj_num_info.cj_num_detail.num3
          })
          setTimeout(function () {
            _this.setData({
              num2: e.cj_num_info.cj_num_detail.num2
            })
            setTimeout(function(){
              _this.setData({
                num1: e.cj_num_info.cj_num_detail.num1
              })
              setTimeout(function () {
                _this.setData({
                  chou: true,
                  tanchuang65:true
                })
              }, 500)
            },200)
          }, 500)
        }, 500)
  },
  z_xinrenyindao7() {
    let _this = this
    let params = {
      "token": wx.getStorageSync("user_token"),
      "five_yindao":'7'
    }
    wx.request({
      url: app.apiurl + 'api/member/upMyYd2',
      method: 'POST',
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 修改请求
      },
      success(res) {
        _this.z_yonghu()
        wx.reLaunch({
          url: '/pages/index/index',
        })
      }
    })
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    if (this.timer) {
      clearInterval(this.timer);
    }
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    if (this.timer) {
      clearInterval(this.timer);
    }
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    //下滑刷新
     let _this = this
     let page_no  = _this.data.page_no
     page_no = page_no+1
     _this.setData({
       page_no:page_no
     })
     _this.z_jilu()
     _this.z_jilu2()
    //  _this.z_jilu7()
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})